<!-- HTML header for doxygen 1.8.8-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <!-- For Mobile Devices -->
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
        <meta name="generator" content="Doxygen 1.8.18"/>
        <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
        <title>HElib: /HElib/include/helib/matching.h Source File</title>
        <!--<link href="tabs.css" rel="stylesheet" type="text/css"/>-->
        <script type="text/javascript" src="dynsections.js"></script>
        <link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
        <link href="doxygen.css" rel="stylesheet" type="text/css" />
        <link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
        <link href='https://fonts.googleapis.com/css?family=Roboto+Slab' rel='stylesheet' type='text/css'>
		<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100;1,700&family=Merriweather&family=Merriweather+Sans&family=Open+Sans&family=Poppins:ital@1&family=Roboto:ital,wght@0,400;1,300;1,900&display=swap" rel="stylesheet"> 
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
        <link href="jquery.smartmenus.bootstrap.css" rel="stylesheet">
        <script type="text/javascript" src="jquery.smartmenus.js"></script>
        <!-- SmartMenus jQuery Bootstrap Addon -->
        <script type="text/javascript" src="jquery.smartmenus.bootstrap.js"></script>
        <!-- SmartMenus jQuery plugin -->
    </head>
    <body style="font-family: 'Merriweather', serif;">
        <nav class="navbar navbar-default" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <a class="navbar-brand">HElib Implementing Homomorphic Encryption</a>
                </div>
            </div>
        </nav>
        <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
            <div class="content" id="content">
                <div class="container">
                    <div class="row">
                        <div class="col-sm-12 panel " style="padding-bottom: 15px;">
                            <div style="margin-bottom: 15px;">
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_d0c4ae63660968bf6b1c77a1e8aecf95.html">helib</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">matching.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="matching_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/* Copyright (C) 2012-2020 IBM Corp.</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * This program is Licensed under the Apache License, Version 2.0</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * (the &quot;License&quot;); you may not use this file except in compliance</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * with the License. You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *   http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> * limitations under the License. See accompanying LICENSE file.</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#ifndef HELIB_MATCHING_H</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#define HELIB_MATCHING_H</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160; </div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="_numb_th_8h.html">helib/NumbTh.h</a>&gt;</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160; </div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacehelib.html">helib</a> {</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160; </div>
<div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="classhelib_1_1_flow_edge.html">   24</a></span>&#160;<span class="keyword">class </span><a class="code" href="classhelib_1_1_flow_edge.html">FlowEdge</a></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;{</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="classhelib_1_1_flow_edge.html#a3424d7608672d7266fadacf6b6cb3122">   27</a></span>&#160;  <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_flow_edge.html#a85e911c020d5a3cab156d61e08e129c5">capacity</a>, <a class="code" href="classhelib_1_1_flow_edge.html#a3424d7608672d7266fadacf6b6cb3122">flow</a>;</div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="classhelib_1_1_flow_edge.html#aef8d31e7fefdbbb41f232821bf24c0c4">   28</a></span>&#160;  <span class="keyword">explicit</span> <a class="code" href="classhelib_1_1_flow_edge.html#aef8d31e7fefdbbb41f232821bf24c0c4">FlowEdge</a>(<span class="keywordtype">long</span> c = 0, <span class="keywordtype">long</span> f = 0)</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;  {</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    <a class="code" href="classhelib_1_1_flow_edge.html#a85e911c020d5a3cab156d61e08e129c5">capacity</a> = c;</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    <a class="code" href="classhelib_1_1_flow_edge.html#a3424d7608672d7266fadacf6b6cb3122">flow</a> = f;</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;  }</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;};</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160; </div>
<div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="namespacehelib.html#a22330000dbd6d83a79f312ccb04405fb">   35</a></span>&#160;<span class="keyword">typedef</span> std::unordered_map&lt;long, FlowEdge&gt; <a class="code" href="namespacehelib.html#a22330000dbd6d83a79f312ccb04405fb">FNeighborList</a>;</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="comment">// FNeighborList[i]=edge-to-node-i</span></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160; </div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="namespacehelib.html#af547f7016fc73b7174a2018ea28ef298">   38</a></span>&#160;<span class="keyword">typedef</span> std::vector&lt;FNeighborList&gt; <a class="code" href="namespacehelib.html#af547f7016fc73b7174a2018ea28ef298">FlowGraph</a>;</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="comment">// FlowGraph[i][j] is the edge i-&gt;j</span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160; </div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="keywordtype">long</span> <a class="code" href="namespacehelib.html#a5e9f98f558e2fcf0a90b77e74f54958f">maximum_flow</a>(<a class="code" href="namespacehelib.html#af547f7016fc73b7174a2018ea28ef298">FlowGraph</a>&amp; fg, <span class="keywordtype">long</span> src, <span class="keywordtype">long</span> sink);</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="comment">// Use the Edmonds-Karp max-flow algorithm</span></div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160; </div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="classhelib_1_1_labeled_edge.html">   46</a></span>&#160;<span class="keyword">class </span><a class="code" href="classhelib_1_1_labeled_edge.html">LabeledEdge</a></div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;{</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="classhelib_1_1_labeled_edge.html#a9ecf7ea39e43d201fbc0900b0aebc540">   49</a></span>&#160;  <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_labeled_edge.html#a4b228ac295592103a453cb8cb7502c15">from</a>, <a class="code" href="classhelib_1_1_labeled_edge.html#a9ecf7ea39e43d201fbc0900b0aebc540">to</a>;</div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="classhelib_1_1_labeled_edge.html#a9b92e8984b850b1c8c26591db10a360b">   50</a></span>&#160;  <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_labeled_edge.html#a9b92e8984b850b1c8c26591db10a360b">label</a>;</div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="classhelib_1_1_labeled_edge.html#a7faca1b83ff7a4e884c6f401d0d15169">   51</a></span>&#160;  <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_labeled_edge.html#a7faca1b83ff7a4e884c6f401d0d15169">color</a>;</div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="classhelib_1_1_labeled_edge.html#a38b01d9de2c49caa69328862d19ac6e7">   52</a></span>&#160;  <a class="code" href="classhelib_1_1_labeled_edge.html#a38b01d9de2c49caa69328862d19ac6e7">LabeledEdge</a>(<span class="keywordtype">long</span> f, <span class="keywordtype">long</span> t, <span class="keywordtype">long</span> l = 0, <span class="keywordtype">long</span> c = 0)</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;  {</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    <a class="code" href="classhelib_1_1_labeled_edge.html#a4b228ac295592103a453cb8cb7502c15">from</a> = f;</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    <a class="code" href="classhelib_1_1_labeled_edge.html#a9ecf7ea39e43d201fbc0900b0aebc540">to</a> = t;</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    <a class="code" href="classhelib_1_1_labeled_edge.html#a9b92e8984b850b1c8c26591db10a360b">label</a> = l;</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    <a class="code" href="classhelib_1_1_labeled_edge.html#a7faca1b83ff7a4e884c6f401d0d15169">color</a> = c;</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;  }</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;};</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160; </div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="namespacehelib.html#ab3940838420e66ad737389ec211730b3">   61</a></span>&#160;<span class="keyword">typedef</span> std::unordered_multimap&lt;long, LabeledEdge&gt; <a class="code" href="namespacehelib.html#ab3940838420e66ad737389ec211730b3">LNeighborList</a>;</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160; </div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="classhelib_1_1_labeled_vertex.html">   65</a></span>&#160;<span class="keyword">class </span><a class="code" href="classhelib_1_1_labeled_vertex.html">LabeledVertex</a></div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;{</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="classhelib_1_1_labeled_vertex.html#a7f161b0c3325f723c521563c3abfb413">   68</a></span>&#160;  <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_labeled_vertex.html#a7f161b0c3325f723c521563c3abfb413">name</a>;</div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="classhelib_1_1_labeled_vertex.html#a741eca5bf6957f1b04751965168f8361">   69</a></span>&#160;  <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_labeled_vertex.html#a741eca5bf6957f1b04751965168f8361">label</a>; <span class="comment">// We don&#39;t really use the label, but why not..</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="classhelib_1_1_labeled_vertex.html#a375a934d2cc7201924264dfe8195ce6c">   70</a></span>&#160;  <a class="code" href="namespacehelib.html#ab3940838420e66ad737389ec211730b3">LNeighborList</a> <a class="code" href="classhelib_1_1_labeled_vertex.html#a375a934d2cc7201924264dfe8195ce6c">neighbors</a>;</div>
<div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="classhelib_1_1_labeled_vertex.html#a032256ea31825078606e77f6ee4a77b5">   71</a></span>&#160;  <span class="keyword">explicit</span> <a class="code" href="classhelib_1_1_labeled_vertex.html#a032256ea31825078606e77f6ee4a77b5">LabeledVertex</a>(<span class="keywordtype">long</span> n, <span class="keywordtype">long</span> l = 0) { <a class="code" href="classhelib_1_1_labeled_vertex.html#a7f161b0c3325f723c521563c3abfb413">name</a> = n, <a class="code" href="classhelib_1_1_labeled_vertex.html#a741eca5bf6957f1b04751965168f8361">label</a> = l; }</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160; </div>
<div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="classhelib_1_1_labeled_vertex.html#aa3069caddd87f8f84a4a10443cb948c4">   73</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_labeled_vertex.html#aa3069caddd87f8f84a4a10443cb948c4">addEdge</a>(<span class="keywordtype">long</span> nn, <span class="keywordtype">long</span> l = 0, <span class="keywordtype">long</span> c = 0)</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;  { <span class="comment">// allow parallel edges</span></div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <a class="code" href="classhelib_1_1_labeled_vertex.html#a375a934d2cc7201924264dfe8195ce6c">neighbors</a>.insert(</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        std::pair&lt;long, LabeledEdge&gt;(nn, <a class="code" href="classhelib_1_1_labeled_edge.html">LabeledEdge</a>(<a class="code" href="classhelib_1_1_labeled_vertex.html#a7f161b0c3325f723c521563c3abfb413">name</a>, nn, l, c)));</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;  }</div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="classhelib_1_1_labeled_vertex.html#a13807a50f2687ccba9637a705d5d76b9">   78</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_labeled_vertex.html#a13807a50f2687ccba9637a705d5d76b9">addNeighbor</a>(<span class="keywordtype">long</span> nn, <span class="keywordtype">long</span> l = 0, <span class="keywordtype">long</span> c = 0)</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;  { <span class="comment">// dont insert a parallel edge</span></div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="classhelib_1_1_labeled_vertex.html#a375a934d2cc7201924264dfe8195ce6c">neighbors</a>.count(nn) == 0)</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;      <a class="code" href="classhelib_1_1_labeled_vertex.html#a375a934d2cc7201924264dfe8195ce6c">neighbors</a>.insert(</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;          std::pair&lt;long, LabeledEdge&gt;(nn, <a class="code" href="classhelib_1_1_labeled_edge.html">LabeledEdge</a>(<a class="code" href="classhelib_1_1_labeled_vertex.html#a7f161b0c3325f723c521563c3abfb413">name</a>, nn, l, c)));</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;  }</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;};</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160; </div>
<div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="classhelib_1_1_bipartitle_graph.html">   87</a></span>&#160;<span class="keyword">class </span><a class="code" href="classhelib_1_1_bipartitle_graph.html">BipartitleGraph</a></div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;{</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;  <span class="comment">// Construct a flow graph corresponding to this bipartite graph</span></div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;  <span class="keywordtype">void</span> buildFlowGraph(<a class="code" href="namespacehelib.html#af547f7016fc73b7174a2018ea28ef298">FlowGraph</a>&amp; fg);</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160; </div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="classhelib_1_1_bipartitle_graph.html#a9ad42cee33f8671d247f495a565d5a87">   93</a></span>&#160;  std::vector&lt;LabeledVertex&gt; <a class="code" href="classhelib_1_1_bipartitle_graph.html#a9ad42cee33f8671d247f495a565d5a87">left</a>; <span class="comment">//  the right side is implicit</span></div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160; </div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="classhelib_1_1_bipartitle_graph.html#a1013c2c8c81100828bc0e287fad67805">   95</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_bipartitle_graph.html#a1013c2c8c81100828bc0e287fad67805">addEdge</a>(<span class="keywordtype">long</span> from, <span class="keywordtype">long</span> to, <span class="keywordtype">long</span> label, <span class="keywordtype">long</span> color = 0)</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;  {</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">long</span> sz = <a class="code" href="classhelib_1_1_bipartitle_graph.html#a9ad42cee33f8671d247f495a565d5a87">left</a>.size(); sz &lt;= from; sz++) <span class="comment">// insert nodes if needed</span></div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;      <a class="code" href="classhelib_1_1_bipartitle_graph.html#a9ad42cee33f8671d247f495a565d5a87">left</a>.push_back(<a class="code" href="classhelib_1_1_labeled_vertex.html">LabeledVertex</a>(sz));</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <a class="code" href="classhelib_1_1_bipartitle_graph.html#a9ad42cee33f8671d247f495a565d5a87">left</a>.at(from).addEdge(to, label, color); <span class="comment">// insert the edge itself</span></div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;  }</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160; </div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;  <span class="comment">// Partition the graph into maximum matchings, color by i=1,2,3,...</span></div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;  <span class="comment">// the edges of the i&#39;th matching.</span></div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_bipartitle_graph.html#afe741ae7bf1ec4ae831e7bc8977222a2">partitionToMatchings</a>();</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_bipartitle_graph.html#a4e99c7a0207d2eb65c10f1191e5b9a47">printout</a>();</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;};</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160; </div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;} <span class="comment">// namespace helib</span></div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160; </div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;<span class="preprocessor">#endif // ifndef HELIB_MATCHING_H</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclasshelib_1_1_flow_edge_html"><div class="ttname"><a href="classhelib_1_1_flow_edge.html">helib::FlowEdge</a></div><div class="ttdoc">An edge in a flow graph.</div><div class="ttdef"><b>Definition:</b> matching.h:25</div></div>
<div class="ttc" id="anamespacehelib_html_af547f7016fc73b7174a2018ea28ef298"><div class="ttname"><a href="namespacehelib.html#af547f7016fc73b7174a2018ea28ef298">helib::FlowGraph</a></div><div class="ttdeci">std::vector&lt; FNeighborList &gt; FlowGraph</div><div class="ttdef"><b>Definition:</b> matching.h:38</div></div>
<div class="ttc" id="anamespacehelib_html_a5e9f98f558e2fcf0a90b77e74f54958f"><div class="ttname"><a href="namespacehelib.html#a5e9f98f558e2fcf0a90b77e74f54958f">helib::maximum_flow</a></div><div class="ttdeci">long maximum_flow(FlowGraph &amp;fg, long src, long sink)</div><div class="ttdef"><b>Definition:</b> matching.cpp:177</div></div>
<div class="ttc" id="a_numb_th_8h_html"><div class="ttname"><a href="_numb_th_8h.html">NumbTh.h</a></div><div class="ttdoc">Miscellaneous utility functions.</div></div>
<div class="ttc" id="aclasshelib_1_1_labeled_vertex_html_a13807a50f2687ccba9637a705d5d76b9"><div class="ttname"><a href="classhelib_1_1_labeled_vertex.html#a13807a50f2687ccba9637a705d5d76b9">helib::LabeledVertex::addNeighbor</a></div><div class="ttdeci">void addNeighbor(long nn, long l=0, long c=0)</div><div class="ttdef"><b>Definition:</b> matching.h:78</div></div>
<div class="ttc" id="anamespacehelib_html_ab3940838420e66ad737389ec211730b3"><div class="ttname"><a href="namespacehelib.html#ab3940838420e66ad737389ec211730b3">helib::LNeighborList</a></div><div class="ttdeci">std::unordered_multimap&lt; long, LabeledEdge &gt; LNeighborList</div><div class="ttdef"><b>Definition:</b> matching.h:61</div></div>
<div class="ttc" id="aclasshelib_1_1_labeled_edge_html_a9ecf7ea39e43d201fbc0900b0aebc540"><div class="ttname"><a href="classhelib_1_1_labeled_edge.html#a9ecf7ea39e43d201fbc0900b0aebc540">helib::LabeledEdge::to</a></div><div class="ttdeci">long to</div><div class="ttdef"><b>Definition:</b> matching.h:49</div></div>
<div class="ttc" id="aclasshelib_1_1_bipartitle_graph_html_afe741ae7bf1ec4ae831e7bc8977222a2"><div class="ttname"><a href="classhelib_1_1_bipartitle_graph.html#afe741ae7bf1ec4ae831e7bc8977222a2">helib::BipartitleGraph::partitionToMatchings</a></div><div class="ttdeci">void partitionToMatchings()</div><div class="ttdef"><b>Definition:</b> matching.cpp:53</div></div>
<div class="ttc" id="aclasshelib_1_1_labeled_vertex_html_a741eca5bf6957f1b04751965168f8361"><div class="ttname"><a href="classhelib_1_1_labeled_vertex.html#a741eca5bf6957f1b04751965168f8361">helib::LabeledVertex::label</a></div><div class="ttdeci">long label</div><div class="ttdef"><b>Definition:</b> matching.h:69</div></div>
<div class="ttc" id="aclasshelib_1_1_bipartitle_graph_html_a1013c2c8c81100828bc0e287fad67805"><div class="ttname"><a href="classhelib_1_1_bipartitle_graph.html#a1013c2c8c81100828bc0e287fad67805">helib::BipartitleGraph::addEdge</a></div><div class="ttdeci">void addEdge(long from, long to, long label, long color=0)</div><div class="ttdef"><b>Definition:</b> matching.h:95</div></div>
<div class="ttc" id="aclasshelib_1_1_labeled_edge_html_a38b01d9de2c49caa69328862d19ac6e7"><div class="ttname"><a href="classhelib_1_1_labeled_edge.html#a38b01d9de2c49caa69328862d19ac6e7">helib::LabeledEdge::LabeledEdge</a></div><div class="ttdeci">LabeledEdge(long f, long t, long l=0, long c=0)</div><div class="ttdef"><b>Definition:</b> matching.h:52</div></div>
<div class="ttc" id="aclasshelib_1_1_flow_edge_html_aef8d31e7fefdbbb41f232821bf24c0c4"><div class="ttname"><a href="classhelib_1_1_flow_edge.html#aef8d31e7fefdbbb41f232821bf24c0c4">helib::FlowEdge::FlowEdge</a></div><div class="ttdeci">FlowEdge(long c=0, long f=0)</div><div class="ttdef"><b>Definition:</b> matching.h:28</div></div>
<div class="ttc" id="aclasshelib_1_1_labeled_vertex_html_a375a934d2cc7201924264dfe8195ce6c"><div class="ttname"><a href="classhelib_1_1_labeled_vertex.html#a375a934d2cc7201924264dfe8195ce6c">helib::LabeledVertex::neighbors</a></div><div class="ttdeci">LNeighborList neighbors</div><div class="ttdef"><b>Definition:</b> matching.h:70</div></div>
<div class="ttc" id="anamespacehelib_html_a22330000dbd6d83a79f312ccb04405fb"><div class="ttname"><a href="namespacehelib.html#a22330000dbd6d83a79f312ccb04405fb">helib::FNeighborList</a></div><div class="ttdeci">std::unordered_map&lt; long, FlowEdge &gt; FNeighborList</div><div class="ttdef"><b>Definition:</b> matching.h:35</div></div>
<div class="ttc" id="aclasshelib_1_1_flow_edge_html_a3424d7608672d7266fadacf6b6cb3122"><div class="ttname"><a href="classhelib_1_1_flow_edge.html#a3424d7608672d7266fadacf6b6cb3122">helib::FlowEdge::flow</a></div><div class="ttdeci">long flow</div><div class="ttdef"><b>Definition:</b> matching.h:27</div></div>
<div class="ttc" id="aclasshelib_1_1_labeled_vertex_html_a7f161b0c3325f723c521563c3abfb413"><div class="ttname"><a href="classhelib_1_1_labeled_vertex.html#a7f161b0c3325f723c521563c3abfb413">helib::LabeledVertex::name</a></div><div class="ttdeci">long name</div><div class="ttdef"><b>Definition:</b> matching.h:68</div></div>
<div class="ttc" id="aclasshelib_1_1_labeled_edge_html_a7faca1b83ff7a4e884c6f401d0d15169"><div class="ttname"><a href="classhelib_1_1_labeled_edge.html#a7faca1b83ff7a4e884c6f401d0d15169">helib::LabeledEdge::color</a></div><div class="ttdeci">long color</div><div class="ttdef"><b>Definition:</b> matching.h:51</div></div>
<div class="ttc" id="anamespacehelib_html"><div class="ttname"><a href="namespacehelib.html">helib</a></div><div class="ttdef"><b>Definition:</b> apiAttributes.h:21</div></div>
<div class="ttc" id="aclasshelib_1_1_labeled_edge_html_a4b228ac295592103a453cb8cb7502c15"><div class="ttname"><a href="classhelib_1_1_labeled_edge.html#a4b228ac295592103a453cb8cb7502c15">helib::LabeledEdge::from</a></div><div class="ttdeci">long from</div><div class="ttdef"><b>Definition:</b> matching.h:49</div></div>
<div class="ttc" id="aclasshelib_1_1_labeled_vertex_html_a032256ea31825078606e77f6ee4a77b5"><div class="ttname"><a href="classhelib_1_1_labeled_vertex.html#a032256ea31825078606e77f6ee4a77b5">helib::LabeledVertex::LabeledVertex</a></div><div class="ttdeci">LabeledVertex(long n, long l=0)</div><div class="ttdef"><b>Definition:</b> matching.h:71</div></div>
<div class="ttc" id="aclasshelib_1_1_labeled_vertex_html_aa3069caddd87f8f84a4a10443cb948c4"><div class="ttname"><a href="classhelib_1_1_labeled_vertex.html#aa3069caddd87f8f84a4a10443cb948c4">helib::LabeledVertex::addEdge</a></div><div class="ttdeci">void addEdge(long nn, long l=0, long c=0)</div><div class="ttdef"><b>Definition:</b> matching.h:73</div></div>
<div class="ttc" id="aclasshelib_1_1_labeled_edge_html_a9b92e8984b850b1c8c26591db10a360b"><div class="ttname"><a href="classhelib_1_1_labeled_edge.html#a9b92e8984b850b1c8c26591db10a360b">helib::LabeledEdge::label</a></div><div class="ttdeci">long label</div><div class="ttdef"><b>Definition:</b> matching.h:50</div></div>
<div class="ttc" id="aclasshelib_1_1_labeled_vertex_html"><div class="ttname"><a href="classhelib_1_1_labeled_vertex.html">helib::LabeledVertex</a></div><div class="ttdoc">A generic node in a graph with some labels.</div><div class="ttdef"><b>Definition:</b> matching.h:66</div></div>
<div class="ttc" id="aclasshelib_1_1_labeled_edge_html"><div class="ttname"><a href="classhelib_1_1_labeled_edge.html">helib::LabeledEdge</a></div><div class="ttdoc">A generic directed edge in a graph with some labels.</div><div class="ttdef"><b>Definition:</b> matching.h:47</div></div>
<div class="ttc" id="aclasshelib_1_1_flow_edge_html_a85e911c020d5a3cab156d61e08e129c5"><div class="ttname"><a href="classhelib_1_1_flow_edge.html#a85e911c020d5a3cab156d61e08e129c5">helib::FlowEdge::capacity</a></div><div class="ttdeci">long capacity</div><div class="ttdef"><b>Definition:</b> matching.h:27</div></div>
<div class="ttc" id="aclasshelib_1_1_bipartitle_graph_html_a4e99c7a0207d2eb65c10f1191e5b9a47"><div class="ttname"><a href="classhelib_1_1_bipartitle_graph.html#a4e99c7a0207d2eb65c10f1191e5b9a47">helib::BipartitleGraph::printout</a></div><div class="ttdeci">void printout()</div><div class="ttdef"><b>Definition:</b> matching.cpp:37</div></div>
<div class="ttc" id="aclasshelib_1_1_bipartitle_graph_html_a9ad42cee33f8671d247f495a565d5a87"><div class="ttname"><a href="classhelib_1_1_bipartitle_graph.html#a9ad42cee33f8671d247f495a565d5a87">helib::BipartitleGraph::left</a></div><div class="ttdeci">std::vector&lt; LabeledVertex &gt; left</div><div class="ttdef"><b>Definition:</b> matching.h:93</div></div>
<div class="ttc" id="aclasshelib_1_1_bipartitle_graph_html"><div class="ttname"><a href="classhelib_1_1_bipartitle_graph.html">helib::BipartitleGraph</a></div><div class="ttdoc">A bipartite flow graph.</div><div class="ttdef"><b>Definition:</b> matching.h:88</div></div>
<!-- HTML footer for doxygen 1.8.8-->
<!-- start footer part -->
</div>
</div>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
        <script type="text/javascript" src="doxy-boot.js"></script>
</html>
